package com.lichuan.zhaoshangdemo.controller;

import com.lichuan.zhaoshangdemo.common.Result;
import com.lichuan.zhaoshangdemo.entity.MenuItems;
import com.lichuan.zhaoshangdemo.service.MenuItemsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 64307
 */
@Slf4j
@RestController
@RequestMapping("/menuitems")
public class MenuItemsController {

    @Autowired
    private MenuItemsService menuItemsService;

    @GetMapping("/get")
    public Result<List<MenuItems>> get() {

        List<MenuItems> list = menuItemsService.get().getData();
        return Result.success(list);
    }
}
